def dec(func):
    u"""定义一个装饰器"""

    def inner(*args, **kwargs):
        try:
            func(*args, **kwargs)
        except Exception as e:
            print(u"0不能作为被除数")
            raise e
    return inner


@dec
def div(a, b):
    u"""定义一个做除法的函数"""
    print(a / b)


div(4, 0)
